<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>系统日志管理</title>
<link href="css_body.css" rel="stylesheet" type="text/css" />
<script language="javascript">

//获得选中文件的文件名
function getCheckboxItem(){
	 var allSel="";
	 if(document.form1.logs.value) return document.form1.logs.value;
	 for(i=0;i<document.form1.logs.length;i++)
	 {
		 if(document.form1.logs[i].checked){
			 if(allSel=="")
				 allSel=document.form1.logs[i].value;
			 else
				 allSel=allSel+"`"+document.form1.logs[i].value;
		 }
	 }
	 return allSel;	
}

function ReSel(){
	for(i=0;i<document.form1.logs.length;i++){
		if(document.form1.logs[i].checked) document.form1.logs[i].checked = false;
		else document.form1.logs[i].checked = true;
	}
}

function DelSel(){
	 var nid = getCheckboxItem();
	 if(nid==""){
		  alert("请选择项目!\r\n");
		  return ;
	 }
	 location.href = "log_edit.php?dopost=del&ids="+nid;
}

function ClearLog(){
	 location.href = "log_edit.php?dopost=clear";
}

</script>
</head>
<body >
<div class="bodytitle">
	<div class="bodytitleleft"></div>
  <div class="bodytitletxt">系统设置</div>
</div>
<table width="96%" border="0" cellpadding="0" cellspacing="0" class="tbtitle" style="background:#F0F0F0; border:1px solid #DDD;line-height:31px;height:31px;">
  <tr>
    <td width="20%" height="18"><strong>管理系统日志：</strong></td>
    <td width="80%" align="right">&nbsp;</td>
  </tr>
</table>
<table width="96%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" style="background:#E2F5BC;">
  <tr align="center"> 
    <td colspan="7" bgcolor="#EDF9D5">
	  <table width="98%" border="0" cellspacing="0" cellpadding="0">
        <form name='formsearch'>
		<tr>
          <td height="35" align="left">
		  管理员：
		  <select name="adminid" id="adminid" style="width:80">
		  <option value="0" selected>--全部--</option>
		  <?php echo $adminlist?>
		  </select>
		  IP地址：
            <input name="cip" type="text" id="cip" size="15" style="width:100">
            时间： 
            <select name="dtime" id="dtime">
              <option value="0" selected>--全部--</option>
              <option value="7">一周内</option>
              <option value="15">15天内</option>
              <option value="30">30天以内</option>
              <option value="60">60天以内</option>
            </select> 
			&nbsp;
            <input type="submit" name="Submit" value="搜索" class="inputbut" /></td>
        </tr>
		</form>
      </table></td>
  </tr>
  <tr align="center" bgcolor="#FCFDF7"> 
    <td width="8%">选择</td>
    <td width="11%">管理员</td>
    <td width="15%">访问文件</td>
    <td width="8%">方式</td>
    <td width="14%">访问IP</td>
    <td width="16%">时间</td>
    <td width="28%">Query参数</td>
  </tr>
  <form name="form1">
    <?php 
  $mylist = $dlist->GetDataList();
  while($row = $mylist->GetArray('dm'))
  {
 ?>
    <tr align="center" bgcolor="#FFFFFF"> 
      <td><input name='logs' type='checkbox' class='np' id="logs" value='<?php echo $row['lid']?>'></td>
      <td> 
        <?php echo $row['userid']?>
      </td>
      <td><input type="text" value="<?php echo $row['filename']?>" name="t0" style="width:100"></td>
      <td> 
        <?php echo $row['method']?>
      </td>
      <td> 
        <?php echo $row['cip']?>
      </td>
      <td> 
        <?php echo strftime("%y/%m/%d %H:%M:%S",$row['dtime'])?>
      </td>
      <td><input type="text" value="<?php echo $row['query']?>" name="t1" style="width:280"></td>
    </tr>
    <?php  } ?>
  </form>
  <tr> 
    <td height="30" colspan="7" bgcolor="#FCFDF7">
    	&nbsp; <input type="button" name="b5" value="反选" onClick="ReSel();" class="inputbut" /> 
      &nbsp; <input type="button" name="b6" value="删除所选" onClick="DelSel();" class="inputbut" /> 
      &nbsp; <input type="button" name="b7" value="清空所有日志" onClick="ClearLog();" class="inputbut" /> 
    </td>
  </tr>
  <tr> 
    <td height="24" colspan="7" align="center" bgcolor="#EDF9D5"> 
      <?php echo $dlist->GetPageList(7);?>    </td>
  </tr>
</table>
</body>
</html>
